package cn.zjitc.ptaLearn.ch07.ex15;

/**
 * @author Zixuan Xu
 * @date
 */
/*
    声明一个抽象Animal类，此类中定义抽象方法shout()；
    声明Dog类、Cat类，均继承自Animal类，并重写了shout()方法；

输出样例:
    小狗汪汪叫
    小猫喵喵叫
 */
public class Main {
    public static void main(String[] args) {
        Animal dog = new Dog();
        dog.shout();
        Animal cat = new Cat();
        cat.shout();
    }
}

abstract class Animal {
    abstract void shout();
}

class Dog extends Animal{
    @Override
    void shout() {
        System.out.println("小狗汪汪叫");
    }
}

class Cat extends Animal{
    @Override
    void shout() {
        System.out.println("小猫喵喵叫");
    }
}
